home *** CD-ROM | disk | FTP | other *** search
- /* (C) Copyright 1991 Dave Fritsche (wb8zxu), All Rights Reserved.
- *
- * Redistribution and use in source and binary forms are permitted for
- * non-commercial use, provided that the above copyright notice and this
- * paragraph are duplicated in all such forms. THIS SOFTWARE IS PROVIDED
- * ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
- * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE.
- */
- /*bdoc
- * Function SETATT
- *
- * Written: Dave Fritsche
- * Date: July, 1987
- *
- * Function to set attributes on screen.
- * 0 -- All attributes off
- * 1 -- Bold on
- * 2 -- Faint on
- * 3 -- Italic on
- * 5 -- Blink on
- * 6 -- Rapid blink on
- * 7 -- Reverse video on
- * 8 -- Concealed on
- * Syntax:
- * setatt(attribute)
- * Where:
- * attribute = Integer containing the attribute to add
- * Attributes are cumulative. There must be a global variable defined
- * in function "main" called "attrib". This is a char-type variable
- * that will contain the current attributes.
- edoc*/
-
- #include <stdio.h>
-
- extern char attrib;
-
- setatt(attr)
- int attr;
- {
- int ps, first, n;
-
- switch (attr)
- {
- case 0:
- attrib = 0;
- lowvideo();
- textattr(0x07);
- break;
- case 1:
- attrib = attrib | 1;
- highvideo();
- break;
- case 2:
- attrib = attrib | 2;
- lowvideo();
- break;
- case 3:
- attrib = attrib | 4;
- break;
- case 5:
- case 6:
- attrib = attrib | 8;
- if (attrib & 32)
- textattr(0xf0);
- else
- if (attrib & 1)
- textattr(0x8f);
- else
- textattr(0x87);
- break;
- case 7:
- attrib = attrib | 32;
- if (attrib & 8)
- textattr(0xf0);
- else
- textattr(0x70);
- break;
- case 8:
- attrib = attrib | 64;
- break;
- default:
- break;
- }
- }
-